<!--
  ~ Copyright [2021-2021] [ahoo wang <ahoowang@qq.com> (https://github.com/Ahoo-Wang)].
  ~ Licensed under the Apache License, Version 2.0 (the "License");
  ~ you may not use this file except in compliance with the License.
  ~ You may obtain a copy of the License at
  ~      http://www.apache.org/licenses/LICENSE-2.0
  ~ Unless required by applicable law or agreed to in writing, software
  ~ distributed under the License is distributed on an "AS IS" BASIS,
  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  ~ See the License for the specific language governing permissions and
  ~ limitations under the License.
  -->

<div class="content">
  <nz-row [nzGutter]="16">
    <nz-col [nzSpan]="8">
      <nz-card routerLink="/namespace">
        <nz-statistic [nzValue]="(stat.namespaces | number)!" nzTitle="Namespaces"></nz-statistic>
      </nz-card>
    </nz-col>
    <nz-col [nzSpan]="8">
      <nz-card routerLink="/service">
        <nz-statistic [nzValue]="(stat.instances | number)!" nzTitle="Instances"></nz-statistic>
      </nz-card>
    </nz-col>
    <nz-col [nzSpan]="8">
      <nz-card routerLink="/config">
        <nz-statistic [nzValue]="(stat.configs | number)!" nzTitle="Configs"></nz-statistic>
      </nz-card>
    </nz-col>
  </nz-row>
  <nz-divider nzText="Services"></nz-divider>
  <nz-row [nzGutter]="16">
    <nz-col [nzSpan]="8">
      <nz-card routerLink="/service">
        <nz-statistic [nzValue]="(stat.services.total | number)!" nzTitle="Total Services"></nz-statistic>
      </nz-card>
    </nz-col>
    <nz-col [nzSpan]="8">
      <nz-card routerLink="/service">
        <nz-statistic [nzValue]="(stat.services.health | number)!" nzTitle="Healthy Services (Instances > 0)"
                      [nzValueStyle]="{ color: '#3F8600' }"></nz-statistic>
      </nz-card>
    </nz-col>
    <nz-col [nzSpan]="8">
      <nz-card routerLink="/service">
        <nz-statistic [nzValue]="(stat.services.total-stat.services.health | number)!"
                      [nzValueStyle]="{ color: '#CF1322' }"
                      nzTitle="Unhealthy Services (Instances = 0)"></nz-statistic>
      </nz-card>
    </nz-col>
  </nz-row>
</div>
